<template>
  <h1>{{count}}</h1>
  <button @click="changeCount">修改setup数据</button>
</template>

<script lang="ts">
import {defineComponent} from "vue"
export default defineComponent({
  name: "About",

  //setup函数里的数会直接暴露给模板和组件实例
  //setup数据不是响应式的，
  setup(){
    let count = 0
    const changeCount = () => {
      count++
    }

    return{
      count,
      changeCount,
    }
  }
})
</script>